io.write('ShiJINZhiShu x=') 
x=io.read()
io.write('ZhuanHuanJinZhi N=')
n=io.read()

a={}
i=0
while(true) do
	i=i+1
	a[i]=x%n
	x=(x-x%n)/n
	if(x==0) then
		break
	end
end

for j=#a,1,-1 do
	io.write(a[j])
end
print()
